package jp.ac.aiit.spg.web.wbs;

import javax.ejb.EJB;

import jp.ac.aiit.spg.entity.SpgTask;
import jp.ac.aiit.spg.service.SpgService;

public class DeleteTaskPage {

	@EJB
	private SpgService ss;

	private SpgTask task;

	private int projectid;

	private int taskId;

	private String wbsNumber;

	private String taskName;

	private String memberName;

	public SpgTask getTask() {
		return task;
	}

	public void setTask(SpgTask task) {
		this.task = task;
	}

	public String getMemberName() {
		return memberName;
	}

	public void setMemberName(String memberName) {
		this.memberName = memberName;
	}

	public String getWbsNumber() {
		return wbsNumber;
	}

	public void setWbsNumber(String wbsNumber) {
		this.wbsNumber = wbsNumber;
	}

	public String getTaskName() {
		return taskName;
	}

	public void setTaskName(String taskName) {
		this.taskName = taskName;
	}

	public int getTaskId() {
		return taskId;
	}

	public void setTaskId(int taskId) {
		this.taskId = taskId;
	}

	public int getProjectid() {
		return projectid;
	}

	public void setProjectid(int projectid) {
		this.projectid = projectid;
	}

	public Class initialize() {
		return null;
	}

	public Class prerender() {
		// タスクの取得
		task = ss.getTask(taskId);
		wbsNumber = task.getWbsNumber();
		taskName = task.getName();
		memberName = task.getMember().getUser().getName();

		return null;
	}

	public Class doDelete() {
		ss.deleteTask(taskId);
		return ConfirmTaskPage.class;
	}

}
